package com.jzo2o.customer.controller.consumer;

import com.jzo2o.common.model.Result;
import com.jzo2o.customer.model.dto.request.BankAccountUpsertReqDTO;
import com.jzo2o.customer.service.IBankAccountService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.*;

import javax.annotation.Resource;

/**
 * @author 86188
 */

@RestController("workerAgencyBankAccountController")
@RequestMapping("/agency/bank-account")
@Api(tags = "机构端设置银行账户接口设计")
public class AgencyBankAccountController {

    @Resource
    private IBankAccountService bankAccountService;

    @PostMapping
    @ApiOperation("新增或更新银行账号信息接口")
    public Result<?> bankAccount(@RequestBody BankAccountUpsertReqDTO bankAccountUpsertReqDTO) {
        Result<?> result = bankAccountService.bankAccount(bankAccountUpsertReqDTO);
        return Result.ok();
    }

    @GetMapping("/currentUserBankAccount")
    @ApiOperation(" 获取当前用户银行账号接口")
    public BankAccountUpsertReqDTO currentUserBankAccount() {
        return bankAccountService.currentUserBankAccount();
    }

}
